﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;
using System.Data.SqlClient;
namespace DA
{
    public class DangNhapDA :DBConnection
    {
        public bool CheckLogin(DangNhapDTO item)
        {
            var ds = new DataSet();
            string query = String.Format("select id from DANGNHAP where TaiKhoan = '{0}' and MatKhau = '{1}'", item.TaiKhoan, item.MatKhau);
            if (open())
            {
                sqlDataAdapter = new SqlDataAdapter(query, sqlConnection);
                sqlDataAdapter.Fill(ds);
            }
            close();
            if (ds.Tables[0].Rows.Count!=0)
                return true;
            else
                return false;
           
        }
    }
}
